import type { TABS_LIST, CUSTOM_FLAGS, TYPE_LIST, TODO_STATUS, REMINDER_TYPE } from './dictionary';
export interface IProps {
  buttonPermissions: any;
}

export interface IOption {
  label: string;
  value: string | number;
  disabled?: boolean;
  checked?: boolean;
}

export interface IOriginCreatorOption {
  email?: string;
  mobile?: string;
  name: string;
  userId: number;
}

export interface ICreatorOption extends IOriginCreatorOption {
  label: string;
  value: number;
  checked: boolean;
}

export type ICreatorOptionsObj = Record<string, ICreatorOption>;

export type IGroupOptionsObj = Record<string, IGroupOptions>;

export interface IGroupOptions {
  groupId?: number;
  groupName?: string;
  label?: string;
  value?: number;
  stationIdList?: number[];
  userList?: ICreatorOption[];
}
export interface IOriginCreatorOptions {
  groupList?: IGroupOptions[];
  userList?: IOriginCreatorOption[];
}

export interface ISearchFormData {
  initialValues: IInitialValues;
  marketOptions: IMarketOptions[];
  dealElementOptions: IDealElementOptions[];
  dealElementModalOptions: IDealElementOptions[];
  dealElementDataObj: IDealElementDataObj;
  originDealElementOptions: IOrginDealElementOptions[];
  creatorOptions: ICreatorOption[];
  creatorOptionsObj: ICreatorOptionsObj;
  groupOptions: IGroupOptions[];
  groupOptionsObj: IGroupOptionsObj;
  originCreatorOptions: IOriginCreatorOptions;
}

export interface IInitialValues {
  marketList?: string[];
  stationList?: string[];
  userList?: string[];
  keyWords?: string;
}

export interface IMarketOptions extends IOption {
  code: string;
  name: string;
  provinceIdList: string[];
}
export interface IOrginDealElementOptions {
  id: number;
  label: string;
  value: string;
  children?: IOrginDealElementOptions[];
}

export interface IDealElementOptions {
  id?: number;
  key?: string;
  label?: string;
  parentKey?: number;
  regionId?: string;
  title: string;
  value?: string;
  children?: IDealElementOptions[];
}

export type IDealElementDataObj = Record<number, IDealElementOptions[]>;

export interface IDateData {
  day?: number;
  value?: string;
  isChecked?: boolean;
  isShow?: boolean;
}

export type ICalenderOption = Record<string, ICalenderOptionValue>;

export interface ICalenderOptionValue {
  notice?: boolean; //公告
  todo?: boolean; //代办
  sequence?: boolean; //序列
}

export interface ITodoListType {
  id: number; //待办ID
  calendarDate: string; //代办日期
  pendingStartTime: string; //待办开始时间
  pendingEndTime: string; //待办结束时间
  transactionArrange: string; //待办内容
  status: TODO_STATUS; //状态  0 ：代办   1 ：过期
  createBy: number; //创建人ID
  createName: string; //创建人姓名
  relaNotice: string; //关联公告
  relaSequence: string; //关联序列
  createTime: string; //创建时间
  marketId?: any; // 交易中心id
}

export interface INoticeSequenceListType {
  id: string; //公告序列ID
  date: string; //日期
  marketName: string; //交易中心
  type: TYPE_LIST; //类型（公告、交易序列）
  content: string; //内容
  declarationStartTime: string; //交易时间起
  declarationEndTime: string; //交易时间止
  executionStartDate: string; //执行时间起
  executionEndDate: string; //执行时间止
  createUserName: string; //创建人
  relatedPendingIds: string; //关联待办ids
  customFlag: CUSTOM_FLAGS; //自定义标识
  stationIds: string; // 相关单元ids
  stationNames: string; // 相关单元names
}
export interface ISearchCriteriaData {
  dateList: string[];
  marketList: string[]; //交易中心
  queryType: TABS_LIST; //DB:代办     GG_XL：公告&序列
  keyWords?: string; //关键字
  stationList: string[]; //交易单元
  userList: string[]; //创建人
  refreshUL?: number | string; // 用于刷新
}

export interface ITodoDetailType {
  id: number;
  calendarDate: string; //代办日期
  pendingStartTime: string; //待办开始时间
  pendingEndTime: string; //待办结束时间
  transactionArrange: string; //待办内容
  status: TODO_STATUS; //状态
  createBy: number;
  createName: string; //创建人
  relaNotice: number; //关联公告
  relaSequence: number; //关联序列
  createTime: string; //创建时间
  stationList: IOrginDealElementOptions[];
  reminderType: REMINDER_TYPE; //提醒方式：1-短信; 2-短信+电话
  reminderTime: number[]; //提醒时间
  reminderList: IOriginCreatorOption[]; //提醒对象
  remindFlag: string; // 提醒是否关闭
}

export interface INoticeDetailType {
  id: string; //公告id
  title: string; //标题
  createUserName: string; //创建人
  createTime: string; //创建时间
  marketId: string; //发布单位id
  marketName: string; //发布单位名称
  content: string; //正文(含有html标签格式)
  author: string; //公告作者
  publishTime: string; //发布时间
  attachmentIds: string; //附件ids(,分隔)
  attachmentNames: string; //附件名(,分隔)
  attachmentPaths: string; // 附件路径(,分隔)
  stationIds: string; //相关单元名(,分隔)
  stationNames: string; //相关单元名(,分隔)
  type: TYPE_LIST;
}

export interface ISequenceDetailType {
  id: string; //公告id
  title: string; //标题
  createUserName: string; //创建人
  createTime: string; //创建时间
  marketId: string; //发布单位id
  marketName: string; //发布单位名称
  content: string; //正文(含有html标签格式)
  author: string; //公告作者
  publishTime: string; //发布时间
  attachmentIds: string; //附件ids(,分隔)
  attachmentNames: string; //附件名(,分隔)
  stationIds: string; //相关单元名(,分隔)
  stationNames: string; //相关单元名(,分隔)
  attachmentPaths: string; // 附件路径(,分隔)
  tradeTypeMode: string; //交易方式（1-双边 2-集中 3-挂牌 4-连续竞价 9-其他）
  declarationStartTime: string; //交易申报时间起
  declarationEndTime: string; //交易申报时间止
  executionStartDate: string; //交易执行时间起
  executionEndDate: string; //交易执行时间止
  type: TYPE_LIST;
}

export interface ICompontentsIsLoading {
  calenderIsLoading: boolean;
  listIsLoading: boolean;
}
